<template>
  <div class="app-container">
    <el-form
      ref="detail"
      v-if="form"
      :model="form"
      label-width="120px">
      <el-form-item label="查询时间：">
        {{ form.created_at }}
      </el-form-item>
      <el-form-item label="姓名：">
        {{ form.name }}
      </el-form-item>
      <el-form-item label="身份证：">
        {{ form.id_card }}
      </el-form-item>
      <el-form-item label="描述：">
        {{ form.message }}
      </el-form-item>
      <el-form-item label="认证结果：">
        {{ form.origin_result }}
      </el-form-item>
      <el-form-item label="图片：">
        <span v-if="form.extend && form.extend.photo">
          <img :src="'data:image/png;base64,'+form.extend.photo" alt="">
        </span>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { portraitComparisonDetail } from '@/api/product';
export default {
  name: 'detail',
  props: {
    formData: {
      type: Object,
      default: () => {
        return null;
      },
    },
  },
  data() {
    return {
      form: null
    };
  },
  created(){
    this.getDetail()
  },
  methods: {
    getDetail(){
      portraitComparisonDetail({ id: this.formData.id }).then(res=>{
        this.$set( this, 'form', res.data )
      })
    }
  },
};
</script>
